from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token

from . import views

urlpatterns = [
    #/users/usernames/(?P<username>\w{5,20})/count/5
    url(r'^usernames/(?P<username>\w{5,20})/count/$',views.RegisterUsernameCountAPIView.as_view(),name='usernamecount'),
    url(r'^phones/(?P<mobile>1[345789]\d{9})/count/$', views.RegisterPhoneCountAPIView.as_view(), name='phonecount'),
    url(r'^$', views.RegisterCreateUserView.as_view()),

    url(r'^api-token-auth/', obtain_jwt_token),
    url(r'^auths/', obtain_jwt_token),
    # /users/infos/
    url(r'^infos/$', views.UserCenterView.as_view()),
    url(r'^emails/$', views.UserEmailView.as_view()),

    # url(r'^emails/$', views.UserEmailView.as_view()),
    url(r'^emails/verification/$',views.UserActiveEmailView.as_view()),

    url(r'^addresses/$',views.AddressCreateAPIView.as_view()),

    # /users/browerhistories/
    url(r'^browerhistories/$', views.UserHistoryView.as_view()),

]
"""
   header:       "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
   payload:       eyJleHAiOjE1NDE2NzcwOTEsInVzZXJuYW1lIjoiaGVkYWxvbmciLCJlbWFpbCI6IiIsInVzZXJfaWQiOjZ9.
   signature:     x8g8phvrLunSieqvcb_3GKLVElFFY5goQMcg_2NvXNE"

"""